package org.springframework.license.validate;

import org.springframework.license.service.LicenseServiceManager;
import de.schlichtherle.license.LicenseManager;
import de.schlichtherle.license.LicenseParam;

/**
 * @Title LicenseManagerHolder
 * @Author zhijun.Guo
 * @Email tiankong061015@163.com
 * @Time 2024/9/3 00:26
 * @Description
 */
public class LicenseManagerHolder {

    private static volatile LicenseManager LICENSE_MANAGER;

    public static LicenseManager getInstance(LicenseParam param){
        if(LICENSE_MANAGER == null){
            synchronized (LicenseManagerHolder.class){
                if(LICENSE_MANAGER == null){
                    LICENSE_MANAGER = new LicenseServiceManager(param);
                }
            }
        }

        return LICENSE_MANAGER;
    }
}